
library(testthat)
library(blma)
library(tictoc)
library(parallel)

cores <- detectCores()

test_that("Kakadu produces correct results liang_g1", {
	Kakadu <- get_Kakadu()
	vy <- Kakadu$vy
	mX <- Kakadu$mX
	tic("Kakadu produces correct results liang_g1")
	result <- blma(vy, mX, prior="liang_g1", modelprior="uniform", cores=cores)
	toc()
	expect_equal(result$vinclusion_prob, c(
		0.3469442223401997,0.5033763713275147,0.1710391998737254,0.4686716902393477,
		0.9041282693203453,0.4182787535192226,0.2152694787243199,0.2365794398160191,
		0.1709195101828257,0.9081285313534126,0.9457607536048467,0.9996987392264256,
		0.1584196650685204,0.3866126303418119,0.3524291472817372,0.8329753936885851,
		0.1953702526810372,0.8655055789962616,0.9999999999992009,0.6255640528176040,
		0.9999982103316476,0.2911572010612115
	), tolerance = 1e-8)
})